
<include file="../Public:header" />
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/ui.slider.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/timepicker.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/jquery/ui/i18n/jquery-ui-i18n.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/wbox/wbox-min.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/js/wbox/wbox-min.css" />


<if condition="$act eq 'list'">
<script type="text/javascript">
	$(document).ready(function(){
		parent.showButton("add");
	});
	function doButton(btn) { 
	    if(btn == "add") {
	        location.href = "__URL__/index/act/add";
	    }else if(btn == "del") {
	        var str="";
	        $("input[name*='selected']:checked").each(function(){
	        	str += $(this).val()+",";
	        });
	        if(str.length > 0) {
		        if(confirm("您确认要删除吗？")) {
		        	$.getJSON("__URL__/index_act/act/del", { id: str },
			      			function(data){
			        			if(data.success == 1) {
			        				$("input[name*='selected']").attr('checked', false);
				        			location.reload();
			        			}else if(data.describe){
			        				alert(data.describe);
			        			}else {
			        				alert("请先选择欲删除的条目");
			        			}
			        		});
		        }
	        }else {
		        alert("请先选择欲删除的条目");
	        }
	    }
	}
	function filter(){
		if($("#filter_key").val() == '员工姓名或编号') {
			$("#filter_key").val('');
		}
		$("#form").submit();
	}




		
</script>
<div class="data-list">
       <!-- table class="list">
  		<form action="__URL__/index/" method="post" enctype="multipart/form-data" id="form">
       <thead>
         <tr class="filter">
           <td class="right">时间段:　<input id="time_begin" type="text" value="{$_mapx[filter_time_begin]|default=''}" name="filter_time_begin">　－　<input type="text" id="time_end" value="{$_mapx[filter_time_end]|default=''}" name="filter_time_end"></td>
           <td align="right"><a class="button" onclick="filter();"><span>筛选</span></a></td>
         </tr>
       </thead>
       </form>
     </table> -->
     
     <table class="list">
       <thead>
         <tr style="background-color: rgb(244, 244, 248);">
         	<td width="1" style="text-align: center;">
         	  <input type="checkbox" onclick="$('input[name*=\\\'selected\\\']').attr('checked', this.checked);">
         	</td>
           <td class="left">发送者</td>
           <td class="left">内容</td>
           <td class="left">发送对象</td>
           <td class="left">发送时间</td>
           <td class="left">发送状态</td>
         </tr>
       </thead>
       <tbody>
       <volist name="list" id="val">
         <tr>
           <td style="text-align: center;">
             <input type="checkbox" value="{$val.id}" name="selected[]">
           </td>
           <td class="left" style="width:100px;">{$val['sender']|getUserName}</td>
           <td class="left">{$val['content']}</td>
           <td class="left" style="width:100px;">{$val['accept']}</td>
           <td class="left" style="width:150px;">{$val['create_time']}</td>
           <td class="left" style="width:60px;"><a href="#" onclick="setStatus('{$val.id}')" class="status">查看</a></td> 
         </tr>
       </volist>
       </tbody>
     </table>
      <p align=right>{$page}</p>
</div>
<elseif condition="$act eq 'add' ||$act eq 'edit'"/>
	<include file="index_edit"/>
<elseif condition="$act eq 'status'"/>
	<include file="index_status"/>
</if>

<script type="text/javascript">
	function setStatus(id){
		$(".status").wBox({
			requestType: "iframe",
			target:"__URL__/index/act/status/id/"+id
		});
	}
</script>
<include file="../Public:footer"/>